package com.atguigu.springmvc.controller;

import com.atguigu.springmvc.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author : wenchao.long
 * @date : Created in 2020/11/02 20:11:59 周一
 * @description :
 */
@Controller
@RequestMapping("/data")
public class DataController {

    @RequestMapping("/hello1")
    public String hello1(String name) {
        System.out.println(name);
        return "hello";
    }

    @RequestMapping("/hello2")
    public String hello2(@RequestParam(value = "name", required = false) String name) {
        System.out.println(name);
        return "hello";
    }

    @RequestMapping("/hello3")
    public String hello3(User user) {
        System.out.println(user);
        return "hello";
    }
}
